<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>添加积分价格单</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../../../../elementUI/index.css">
    <link rel="stylesheet" href="../../../../css/index.css">
</head>

<body>
    <div id="app" class="minWidth">
        <el-form :model="form" ref="contract" :rules="rules" inline-message="true" style="width: 100%">
            <div class="table_titel">
                <div class="titel">积分价格单</div>
            </div>
            <el-descriptions :column="4" border size="small">
                </el-descriptions-item>
                <el-descriptions-item label="开始时间">
                    <el-form-item prop="Start_Date"> 
                        <el-date-picker v-model.trim="form.Start_Date" type="datetime" placeholder="请选择开始时间"
                            value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="结算时间">
                    <el-form-item prop="End_Date">
                        <el-date-picker v-model.trim="form.End_Date" type="datetime" placeholder="请选择结算时间"
                            value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="补货时间默认00:00:00">
                    <el-form-item prop="always">
                        <el-time-picker v-model.trim="always" arrow-control placeholder="请选择补货时间默认00:00:00"
                            value-format="HH:mm:ss"></el-date-picker>
                    </el-form-item>
                </el-descriptions-item>
            </el-descriptions>

            <div class="table_titel">
                <div class="titel">积分销售价格单明细</div>
                <div class="operation">
                    <el-button type="primary" size="small" @click="add_integral_unitprice_detail">新增</el-button>
                    <el-button type="danger" size="small" @click="remove_integral_unitprice_detail">删除</el-button>
                </div>
            </div>
            <el-descriptions :column="2" border size="small"
                v-for="(item,index) in form.Children.integral_unitprice_detail" :key="index">
                <el-descriptions-item label="商品编号">
                    <el-form-item>
                        <el-select v-model.trim="item.Article_SerialNumber" placeholder="请选择商品" filterable
                            @change="Change_Unit_Price(index)" style="width: 100%">
                            <el-option v-for="(item,index) in shop" :key="index" :label="item.Article_Name"
                                :value="item.Article_SerialNumber"></el-option>
                        </el-select>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="商品规格">
                    <el-form-item>
                        <el-select :disabled="isDisabled" v-model.trim="item.Article_Specifications_SerialNumber"
                            placeholder="请选择规格" filterable @change="Change_Specifications_Name(index)"
                            style="width: 100%">
                            <el-option v-for="(item,index) in item.specs"
                                :key="item.Article_Specifications_SerialNumber" :label="item.Specifications_Name"
                                :value="item.Article_Specifications_SerialNumber"></el-option>
                        </el-select>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="所需积分">
                    <el-form-item :rules="Integral_Unit_Price"
                        :prop="'Children.integral_unitprice_detail.' + index + '.Integral_Unit_Price'">
                        <el-input v-model.trim="item.Integral_Unit_Price" placeholder="请输入所需积分"></el-input>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="所需金额">
                    <el-form-item :prop="'Children.integral_unitprice_detail.' + index + '.Unit_Price'">
                        <el-input v-model.trim="item.Unit_Price" placeholder="请输入所需金额"></el-input>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="有/无货货主">
                    <el-form-item>
                      <el-radio-group v-model="item.Sign">
                        <el-radio label="无货货主" value="0"></el-radio>
                        <el-radio label="有货货主" value="1"></el-radio>
                      </el-radio-group>
                    </el-form-item>
                  </el-descriptions-item>
                <el-descriptions-item label="分配数量">
                    <el-form-item :rules="Distribute"
                        :prop="'Children.integral_unitprice_detail.' + index + '.Distribute'">
                        <el-input v-model.trim="item.Distribute" placeholder="请输入分配数量"></el-input>
                    </el-form-item>
                </el-descriptions-item>
            </el-descriptions>


            <div class="table_titel">
                <div class="titel">适用店铺</div>
                <div class="operation">
                    <el-button type="primary" size="small" @click="add_integral_scheme_storescope">新增</el-button>
                    <el-button type="danger" size="small" @click="remove_integral_scheme_storescope">删除</el-button>
                </div>
            </div>
            <el-descriptions :column="2" :rules="rules" border size="small"
                v-for="(item,index) in form.Children.integral_unitprice_storescope" :key="index">
                <el-descriptions-item label="门店流水号">
                    <el-form-item prop="Store_SerialNumber">
                        <el-select v-model.trim="item.Store_SerialNumber" placeholder="请选择店铺" filterable
                            style="width: 100%">
                            <el-option v-for="(item,index) in store" :key="index" :label="item.Store_Name"
                                :value="item.Store_SerialNumber"></el-option>
                        </el-select>
                    </el-form-item>
                </el-descriptions-item>
            </el-descriptions>
            <div style="margin-bottom: 100px;">
                <div class="table_titel">
                    <div class="titel">所属栏目</div>
                    <div class="operation">
                        <el-button type="primary" size="small" @click="add_integral_unitprice_column">新增</el-button>
                        <el-button type="danger" size="small" @click="remove_integral_unitprice_column">删除</el-button>
                    </div>
                </div>
                <el-descriptions :column="2" :rules="rules" border size="small"
                    v-for="(item,index) in form.Children.integral_unitprice_column" :key="index">
                    <el-descriptions-item label="所属栏目">
                        <el-form-item prop="ShopColumn_Id">
                            <el-select v-model.trim="item.ShopColumn_Id" placeholder="请选择栏目" filterable
                                style="width: 100%">
                                <el-option-group v-for="(group,index) in column" :key="index" :label="group.label">
                                    <el-option v-for="(item,index) in group.options" :key="index" :label="item.name"
                                        :value="item.ShopColumn_Id"></el-option>
                                </el-option-group>
                            </el-select>
                        </el-form-item>
                    </el-descriptions-item>
                </el-descriptions>
            </div>
            <el-form-item class="form-operation">
                <el-button @click="window.history.back()">返回</el-button>
                <!-- <el-button type="success" @click="onExcel">导入</el-button> -->
                <el-button type="primary" :loading="loading" @click="submitForm('contract')">提交</el-button>
            </el-form-item>
        </el-form>
    </div>
    <script type="text/javascript" src="../../../../js/jquery-3.6.0.min.js"></script>
    <script type="text/javascript" src="../../../../js/jquery.cookie.js"></script>
    <script type="text/javascript" src="../../../../js/vue.min.js"></script>
    <script type="text/javascript" src="../../../../elementUI/index.js"></script>
    <script type="text/javascript" src="../../../../js/utils.js"></script>
    <script type="text/javascript" src="../../../../js/ID_Validity.js"></script>
    <script type="text/javascript" src="../../../../js/FileSaver.min.js"></script>
    <script type="text/javascript" src="../../../../js/FileSaver.js"></script>
    <script type="text/javascript" src="../../../../js/xlsx.full.min.js"></script>
    <script type="text/javascript" src="./js/Edit.js"></script>
</body>

</html>